V = Variables
C = Calculation functions
The VC10CollVal function sets a result on a variable (resul) on the basis of the value from a variable than other 2.
The function follows the following truth table:
Truth table
| val01 > val02 | result = 0 |
All subsequent cases relate to val01 ⇐ val02 and analyze only Val03
| val03 < val01 | result = 1 |
| val01 ⇐ val03 < valore2 | result = 2 |
| val03 >= val02 | result = 3 |
VC10CollVal (val01, val02, val03, Risultato)
Parametri:
| IN/OUT | TIPO VARIABILE | NOME DI ESEMPIO | DIM | |
|---|---|---|---|---|
| IN | SYSTEM | val01 | L/S | Primo valore di comparazione |
| IN | SYSTEM | val02 | L/S | Secondo valore di comparazione |
| IN | SYSTEM | val03 | L/S | Valore da comparare con val01 e val02 |
| OUT | SYSTEM | risultato | B | Variabile contenente il risultato della comparazione secondo la tabella di verità raffigurata sopra |
Esegui la comparazione quando il flag “gfComp” viene posto a 1.
IF gfComp
gfComp = 0
val01 = 1000
val02 = 5000
VC10CollVal (val01, val02, val03, resul)
ENDIF